package cn.tedu.javacv.controller;

import cn.tedu.javacv159.client.JavacvClient;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;


@RestController
@RequestMapping("/api/videos")
@Api(tags = "测试")
@Validated
public class TestController {

    @Autowired
    private JavacvClient javacvClient;

    @PostMapping("/test")
    @ApiOperation(value = "拼接")
    public ResponseEntity test(
            @RequestPart("file") MultipartFile file,
            @RequestParam("intervalTime") Double intervalTime,
            @RequestParam("direction") String direction) {
        return javacvClient.uploadVideo(file, intervalTime, direction);
    }

}
